package com.bifang.common.constant.enums.common;
/**
 * 有效状态
 *
 * @author chenzh
 * @date 2018-08-12
 */
public enum BoolEnum {
    TRUE("1", "是"),
    FALSE("0", "否");
    private String type;
    private String name;

    BoolEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }

    public static BoolEnum getByType(String type) {

        for (BoolEnum typeEnum : values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
